import { SchemaNodeKey } from "@/utils/constants";
import DeviceConfig from "./DeviceConfig";
import SensorConfig from "./SensorConfig";
import { ComponentInternalInstance, getCurrentInstance } from "vue";
/**
 * 详情分类导航，根据Scheme描述分类信息
 */
//根据Schema绘制分类导航
export default defineComponent({
	setup() {
		const { proxy } = getCurrentInstance() as ComponentInternalInstance;
		onMounted(() => {});
		const active = ref(SchemaNodeKey.extNavDeviceConfig);
		return () => {
			return (
				<>
					<el-tabs class="gateway-plc-tabs" v-model={active.value}>
						<el-tab-pane
							label={proxy?.$t("extlower.tab_label.device_config")}
							name={SchemaNodeKey.extNavDeviceConfig}
						></el-tab-pane>
						<el-tab-pane
							label={proxy?.$t("extlower.tab_label.sensor_config")}
							name={SchemaNodeKey.extNavSensorConfig}
						></el-tab-pane>
					</el-tabs>
					{active.value == SchemaNodeKey.extNavDeviceConfig ? <DeviceConfig style="margin-top:-20px" /> : null}
					{active.value == SchemaNodeKey.extNavSensorConfig ? <SensorConfig style="margin-top:-20px" /> : null}
				</>
			);
		};
	}
});
